package com.wzy.service;

import com.wzy.dao.*;
import com.wzy.pojo.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    public boolean findUser(User user) {
        User user2 = userDao.findUser(user);
        if(user2!=null){
            return user.getName().equals(user2.getName()) && user.getPassword().equals(user2.getPassword());
        }else{
            return false;
        }
    }

    public boolean addUser(User user) {
        if(userDao.findUserinfo(user)==null) {
            userDao.addUser(user);
            return true;
        }else{
            return false;
        }
    }
    @Override
    public ExternalPopulation findExternalPopulation(String ID) {


        return null;
    }

}
